using System.Data.Entity.ModelConfiguration;
using Nop.Core.Domain.ShareBuy;

namespace Nop.Data.Mapping.ShareBuy
{
    public partial class ShareBuyCategoryMap : EntityTypeConfiguration<ShareBuyCategory>
    {
        public ShareBuyCategoryMap()
        {
            this.ToTable("ShareBuy_Category_Mapping");
            this.HasKey(pp => pp.Id);
            this.HasRequired(pp => pp.Category)
                .WithMany(c => c.ShareBuyCategories)
                .HasForeignKey(pp => pp.CategoryId);


            this.HasRequired(pp => pp.ShareBuyItem)
                .WithMany(c => c.ShareBuyCategories)
                .HasForeignKey(pp => pp.ShareBuyItemId);
        }
    }
}